Online PHP Function(s){ #Test PHP functions online!; }

  •  
 

ps_set_text_pos

(PECL ps >= 1.1.0)

ps_set_text_posSets position for text output

Description

bool ps_set_text_pos ( resource $psdoc , float $x , float $y )

Set the position for the next text output. You may alternatively set the x and y value separately by calling ps_set_value() and choosing textx respectively texty as the value name.

If you want to output text at a certain position it is more convenient to use ps_show_xy() instead of setting the text position and calling ps_show().

More info
Hide info

Parameters

psdoc

Resource identifier of the postscript file as returned by ps_new().

x

x-coordinate of the new text position.

y

y-coordinate of the new text position.

Return Values

Returns TRUE on success or FALSE on failure.

Examples

Example #1 Placing text at a given position

<?php
$ps 
ps_new();
if (!
ps_open_file($ps"text.ps")) {
  print 
"Cannot open PostScript file\n";
  exit;
}

ps_set_info($ps"Creator""rectangle.php");
ps_set_info($ps"Author""Uwe Steinmann");
ps_set_info($ps"Title""Text placement example");

ps_begin_page($ps596842);
$psfont ps_findfont($ps"Helvetica"""0);
ps_setfont($ps$psfont8.0);
ps_show_xy($ps"Some text at (100, 100)"100100);

ps_set_value($ps"textx"100);
ps_set_value($ps"texty"120);
ps_show($ps"Some text at (100, 120)");
ps_end_page($ps);

ps_delete($ps);
?>

See Also

 

 

 


Comments

 
 
      © 2019 OnlinePHPFunctions.com | Disclaimer |       PHP versions: 7.4.0, 7.3.12, 7.3.5, 7.2.25, 7.2.18, 7.2.4, 7.1.33, 7.1.29, 7.1.0, 7.0.14, 7.0.5, 7.0.4, 7.0.3, 7.0.2, 7.0.1, 5.6.29, 5.6.20, 5.6.19, 5.6.18, 5.6.17, 5.6.2, 5.5.34, 5.5.33, 5.5.32, 5.5.31, 5.5.18, 5.5.5, 5.5.0.a6, 5.5.0.a.5, 5.5.0.a.2, 5.4.34, 5.4.21, 5.4.13, 5.4.12, 5.4.11, 5.4.10, 5.4.9, 5.4.8, 5.4.7, 5.4.6, 5.4.5, 5.4.4, 5.4.3, 5.4.2, 5.4.1, 5.4.0, 5.3.29, 5.3.27, 5.3.23, 5.3.22, 5.3.21, 5.3.20, 5.3.19, 5.3.18, 5.3.17, 5.3.16, 5.3.15, 5.3.14, 5.3.13, 5.3.12, 5.3.11, 5.3.10, 5.3.2, 5.3.1, 5.3.0, 5.2.17, 5.2.16, 5.1.6, 5.1.5, 5.0.5, 5.0.4, 4.4.9